# Maintainer: Bruno Pagani <archange@archlinux.org>

pkgname=utf8cpp
pkgver=3.2.3
pkgrel=1
pkgdesc="UTF-8 with C++ in a Portable Way"
arch=(any)
url="https://github.com/nemtrif/utfcpp"
license=(custom:BSL)
makedepends=(cmake)
source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('3ba9b0dbbff08767bdffe8f03b10e596ca351228862722e4c9d4d126d2865250')

build() {
  cmake -B build -S ${pkgname/8}-${pkgver} \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DUTF8_TESTS=OFF
  make -C build
}

package() {
  make -C build DESTDIR="${pkgdir}" install
  install -Dm644 ${pkgname/8}-${pkgver}/LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
